/**
 * Author@ Cheng Feitian
 * Date: 2021-3-25
 * Description: 初始化列表语法
 */

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;
const int maxn = 1024;

class Person
{
public:
    ////传统方式初始化
    //Person(int a, int b, int c) {
    //	m_A = a;
    //	m_B = b;
    //	m_C = c;
    //}

    //初始化列表方式初始化
    Person(int a, int b, int c) : m_A(a), m_B(b), m_C(c) {}
    void PrintPerson()
    {
        cout << "mA:" << m_A << endl;
        cout << "mB:" << m_B << endl;
        cout << "mC:" << m_C << endl;
    }

private:
    int m_A;
    int m_B;
    int m_C;
};

int main()
{

    Person p(1, 2, 3);
    p.PrintPerson();

    return 0;
}
